﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Web.SessionState;

namespace ProjectStudy.PreventRepeatedLogin
{
    /// <summary>
    /// Ajax_DelLoginInfo 的摘要说明
    /// </summary>
    public class Ajax_DelLoginInfo : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string action=context.Request["action"];
            switch (action)
            {
                case "DelUserInfo": DelUserInfo(context);
                    break;
            }
        }

        private void DelUserInfo(HttpContext context)
        {
            Hashtable h = (Hashtable)context.Application["Online"];
            if (h[context.Session.SessionID] != null)
            {
                h.Remove(context.Session.SessionID);
            }
            context.Application["Online"] = h;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}